*---------------------------------------------------------------------------------------------------*
Stochastic Parameter Generation
Author: Gavin Henry Graham
Date: 11/01/2014

This is a research code and it is hoped that it will be useful. However, the author does not accept 
any responsibility to anyone for the consequences of using the code.
*---------------------------------------------------------------------------------------------------*

Copyright Declaration

The copyright of the code "Stochastic Parameter Generation" rests with the author and is made available 
under a Creative Commons Attribution Non-Commercial No Derivatives licence. Researchers are free 
to copy, distribute or transmit the code on the condition that they attribute it, that they do not 
use it for commercial purposes and that they do not alter, transform or build upon it. For any reuse 
or redistribution, researchers must make clear to others the licence terms of this work.

*---------------------------------------------------------------------------------------------------*

Code Description

If the parameters for the clinoform modelling algorithm are uncertain, the user can specify the mean
and standard deviation of a normal distribution for each parameter. The distribution is then randomly
sampled using a Box-Muller transform (Box and Muller, 1958; see thesis Bibliography for details). 
See Section 2.3.5 (p. 62 of the thesis) and Section A2 (p. 244 of the thesis) for more details on the
method. See Table 2.1 (p. 54 of the thesis) for more information on which parameters have a stochastic 
component.

NOTE: If a prompt is repeated during the running of the application, this means that the stochastic
parameter generation has returned a negative value, and is seeking a new mean and standard deviation
from the user, so that a positive value can be returned. This is because for many of the parameters
it is impossible to have a negative value (can a clinoform have negative length?). The user is advised
to check their distribution to see if it is correct. 

Inputs: 
	
	1. The file path where the Stochastic Parameters will be exported to
	   (e.g. C:\Users\Imperial\Desktop\outputs\ )
	
	2. Mean and standard deviation for the clinoform progradation angle relative 
	   to North, theta, see Table 2.1 (p. 54 of the thesis) for more details (values must return 
	   results between 0 and 360 only)
	
	3. Mean and standard deviation for the proximal boundary entry position, Po, this is 
	   the initial insertion point for clinoforms in the model, See Section 2.3.4 
	   (p. 61 of the thesis) and Table 2.1 (p. 54 of the thesis) for more details (values must 
	   return results between 0 and 1 only)
	
	4. Mean and standard deviation for the exponent of the clinoform shape fucntion, P, See Section 
	   2.3.3  (p. 59 of the thesis) and Table 2.1 (p. 54 of the thesis) for more details (values must 
	   return result greater than than 0)
	
	5. Mean and standard deviation for the length of the top ellipse in depositional strike direction,
	   tw, See Section 2.3.2  (p. 55 of the thesis) and Table 2.1 (p. 54 of the thesis) for more 
	   details (values must return result greater than 0)
	
	6. Mean and standard deviation for the clinoform width/length ratio:
		if ratio < 1 lobate geometries will be returned (e.g Fig. 2.3C p. 56 of the thesis)
		if ratio = 1 a semi-circular geometry will be returned (e.g Fig. 2.3B p. 56 of the thesis)
                if ratio > 1 elongate geometries will be returned (e.g Fig. 2.3A p. 56 of the thesis)
	   (values must return result greater than 0)
	
	7. Mean and standard deviation for the clinoform length, L, See Section 
	   2.3.2  (p. 55 of the thesis) and Table 2.1 (p. 54 of the thesis) for more details (values must 
	   return result greater than than 0)
	
	8. Mean and standard deviation for the clinoform progradation in depostional dip direction, S, 
	   See Section 2.3.4  (p. 61 of the thesis) and Table 2.1 (p. 54 of the thesis) for more details 

	9. Mean and standard deviation for the clinoform migration in depostional strike direction.
 

Outputs:

	1. A file containing a randomly generated value for clinoform progradation. This file is
	   to be read into the clinoform modelling algorithm. See Section 2.3.4 (p. 61 of the thesis)
	   for more details on this parameter

	2. A file containing a randomly generated value for the proximal boundary entry position, Po, this is 
	   the initial insertion point for clinoforms in the model. This file is
	   to be read into the clinoform modelling algorithm. See Section 2.3.4 
	   (p. 61 of the thesis) and Table 2.1 (p. 54 of the thesis) for more details

	3. A file containing a randomly generated value for clinoform shape fucntion, P. This file is
	   to be read into the clinoform modelling algorithm. See Section 2.3.3  (p. 59 of the thesis) 
	   and Table 2.1 (p. 54 of the thesis) for more details

	4. A file containing stochastic parameters for bw, bl, tw, tl, and S (see Table 2.1 (p. 54 of the 
	   thesis) for more details). This file is to be read into the clinoform modelling algorithm.
	
